{% extends "_base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block navi %}
    <li><a href="{{ url_for('web.index') }}">首页</a></li>
    <li class="active"><a href="{{ url_for('web.my_collect') }}">收藏</a></li>
    <li><a href="{{ url_for('web.about') }}">关于</a></li>
{% endblock %}

{% block page_content %}
    <div class="page-header" style="margin-top: -10px;">
        <h3>我的收藏</h3>
    </div>
{#    <div class="me-box">#}
{#        <h5><b>我的收藏</b></h5>#}

        {% if not collectedDocs %}
            您当前没有收藏文档。
        {% endif %}

        <div class="results">
            {% for item in collectedDocs %}
                {% if loop.index != 1 %}
                    <hr>
                {% endif %}
                <div class="result_item">
                    <h4 class="title">
                        <a href="{{ url_for('web.detail', sid=item.id) }}" target="_blank">{{ item.title }}</a>
                    </h4>

                    <p><span class="time">{{ item.releaseTime }} - </span> {{ item.description|safe }} </p>

                    <p>{{ item.stockCode }} - {{ item.companyShortName }}
                        {% if item.type %}
                            - {{ item.type }}
                        {% endif %}
                    </p>
                </div>
            {% endfor %}
        </div>

{#    </div>#}
    <nav style="text-align: center">
        <ul class="pagination">
            <li>
                <a href="/my-collect/{{ pages[0] }}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            {% for page in pages[3:] %}
                {% if page == pages[2] %}
                    <li class="active"><a href="/my-collect/{{ page }}">{{ page }}</a></li>
                {% else %}
                    <li><a href="/my-collect/{{ page }}">{{ page }}</a></li>
                {% endif %}
            {% endfor %}
            <li>
                <a href="/my-collect/{{ pages[1] }}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>

{% endblock %}
